#include <func.h>



void* thread_func(void*p)
{

    printf("I am child thread, %ld\n",(long)p);
    
    return NULL;
}

int main ()
{
    pthread_t th_id;
    long local=1001;
    int ret=pthread_create(&th_id,NULL,thread_func,(void*)local);
    THREAD_ERR_CHECK(ret,"pthread_create");
   
    //在创建一个线程
    local=1002;
    ret=pthread_create(&th_id,NULL,thread_func,(void*)local);
    THREAD_ERR_CHECK(ret,"pthread_create");

    printf("I am main thread \n");
    sleep(1);

  
    return 0;

}